<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'GetSingleTieAndReply.jsp' starting page</title>
    <link href="assets/css/style.css" rel="stylesheet"/>
    <link href="assets/css/content-box/content-box.css" rel="stylesheet"/>
    <script type="text/javascript" src="assets/js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="assets/js/content-box/content-box.js"></script>
	<script type="text/javascript" src="assets/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="assets/js/tiezi/addTzReply.js"></script>
	<script type="text/javascript" src="assets/js/tiezi/fenye2.js"></script>
	<script charset="utf-8" src="assets/plugins/kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="assets/plugins/kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8"
			src="assets/plugins/kindeditor/plugins/code/prettify.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="toppic"]', {
					resizeType : 1,
					allowPreviewEmoticons : false,
					allowImageUpload : false,
					items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link']
				});
			});
		</script>
		<style type="text/css">
				body {
                padding-top:60px;
                padding-bottom:40px;
            }
            textarea {
            		width:600px;
            		height:200px;
            		visibility:hidden
            	}
		</style>

  </head>
  
  <body>	
  	<jsp:include page="../Template/home_top.jsp"></jsp:include>
  <div class="container">
  	<div class="row">
  		<div class="span9">
  				<!-- -- -->
  					<div>
                  		<a href="tieziAction_getAllTiesByFenye.action" class="btn">返回首页</a>
                  		
                  	</div>
   	<form action="tzReplyAction_GetSingleTieAndReply.action" id="pageForm" method="post">
  		<input type="hidden" id="page" name="curPage">
  		<input type="hidden" id="tiezi_id" name="tiezi_id" value="${tiezi_id}">
   	</form>
   	
    <div >
    		页数:
    		<%
    			Integer str =(Integer) request.getAttribute("pageCount");
    			int count = str.intValue();
    			for(int i = 1 ;i <=count;i++){
    		%>
    			<input type="button" class="btn btn-info" value="<%= i %>">
    		<%
    			}
    		 %>
 
    </div>
    
    <div class="row">
	    <div>
	   			<s:iterator value="tieandrels" status="list">
	   				<s:if test="curPage==1">
		   				<div>
			   				<s:if test="#list.index==0">
			   					楼层是:<s:property value="#list.index+1"/><br>
			   					标题是:<s:property value="tags"/><br>
			   					发帖内容是:<s:property value="toppic" escapeHtml="false"/><br>
			   					发帖的ID：<s:property value="id"/><br>
			   					发帖人是:<s:property value="member.name"/><br>
			   					<a href="javascript:void(0)" onclick="show('回复&nbsp;${list.index+1}楼&nbsp;${member.name}&nbsp;的帖子&nbsp;','<s:property value="#list.index+1"/>')"><button class="btn">回复</button></a>
			   				</s:if>
		   				</div><br>
		   				<div>
		   				<s:else>
		   					楼层是:<s:property value="#list.index+1"/><br>
		   					回帖的ID：<s:property value="id"/><br> 
		   					回帖人是:<s:property value="member.name"/><br>
		   					回帖人的内容是:<s:property value="content" escape="false"/><br>
		   					回复帖子的对应的ID:<s:property value="tiezi.id"/><br>
		   					回帖的locate:<s:property value="locate"/><br>
		   					<a href="javascript:void(0)" onclick="show('回复&nbsp;${list.index+1}楼&nbsp;${member.name}&nbsp;的帖子&nbsp;','<s:property value="#list.index+1"/>')"><button class="btn">回复</button></a>
	   					</s:else>
	   					</div><br>
		   			</s:if>
		   			
		   			<s:else>
		   				<div>
		   				楼层是:<s:property value="#list.index+1+(curPage-1)*pageSize"/> <br>
	   					回帖的ID：<s:property value="id"/><br> 
	   					回帖人是:<s:property value="member.name"/><br>
	   					回帖人的内容是:<s:property value="content" escape="false"/><br>
	   					回复帖子的对应的ID:<s:property value="tiezi_id"/><br>
	   					回帖的locate:<s:property value="locate"/><br>
		   				<a href="javascript:void(0)" onclick="show('回复&nbsp;${list.index+1+(curPage-1)*pageSize}楼&nbsp;${member.name}&nbsp;的帖子&nbsp;','${list.index+1+(curPage-1)*pageSize}')"><button class="btn">回复</button></a>
		   				</div><br>
		   			</s:else>
	   				
	   			</s:iterator>
	    </div>
    </div>
    <form action="tzReplyAction_addTzReply.action" onsubmit="return checkform(this)" class="form-inline">
			<input type="hidden" id="tiezi_id" name="tiezi_id" value="${tiezi_id}"><br>
			<input type="hidden" id="replyer" name="replyer_add" value="张山"><br>
			<input type="hidden" id="content" name="content"><br>
			<input type="hidden" id="locate" name="locate" value="1"><br>
			<div style="text-align:center;">
						回复
			</div>
			<label style="margin-left:50px;">
				标题
			</label>
			<input type="text" id="tags" name="tags" value="" tabindex="1">
			
			<div class="postform" align="center">
				<p>
					
					<textarea rows="7" cols="80" class="autosave" name="toppic"
						id="message"  tabindex="2"></textarea>
				</p>
				<p class="btns">
					<button type="submit" tabindex="2" class="btn btn-primary">
						回复帖子
					</button>
					&nbsp;
					<button type="reset" class="btn btn-inverse">
						清空内容
					</button>
			</div>

		</form>
  				<!-- -- -->
		</div>	
  		<div class="span3">
	            	<div class="well">
            		<div class="">
            			<h3>管理入口</h3>
            		</div>
            		<div class="">
            			<a href="member_memberCenter">用户中心</a>
	                    <br>
	                    <a href="admin/member_memberList">管理员中心</a>
            		</div>
	            		
	            </div>
    	               
        </div>	
    </div>
    <jsp:include page="../Template/home_footer.jsp"/>	